package com.fr.base;

import com.fr.base.background.Background;
import com.fr.base.core.ComparatorUtils;
import com.fr.report.io.core.IOHelper;
import com.fr.util.Utils;
import java.awt.Color;
import java.awt.Font;
import java.io.InvalidObjectException;
import java.io.Serializable;
import java.text.Format;
import java.util.HashMap;
import java.util.Map;
import java.util.WeakHashMap;

public class Style
  implements Serializable, Cloneable
{
  private static final long serialVersionUID = -1675056857456167839L;
  private static Map clsFontFamily = new HashMap()
  {
    private static final long serialVersionUID = -6898424690912166160L;
  };
  private static Map initializeStyle = new WeakHashMap();
  public static final int TextStyle_WrapText = 0;
  public static final int TextStyle_SingleLine = 1;
  public static final int TextStyle_SingleLineAdjustFont = 2;
  public static final int TextStyle_MultiLineAdjustFont = 3;
  public static final int VERTICALTEXT = 1;
  public static final int HORIZONTALTEXT = 0;
  public static final int LEFT_TO_RIGHT = 1;
  public static final int RIGHT_TO_LEFT = 0;
  private Format format = null;
  private FRFont frFont = null;
  private Background background = null;
  private byte border_top = 0;
  private byte border_left = 0;
  private byte border_bottom = 0;
  private byte border_right = 0;
  private Color border_top_color = Color.black;
  private Color border_left_color = Color.black;
  private Color border_bottom_color = Color.black;
  private Color border_right_color = Color.black;
  private int horizontal_alignment = 2;
  private int vertical_alignment = 0;
  private int textStyle = 0;
  private int verticalText = 0;
  private int textDirection = 0;
  private int rotation = 0;
  private byte imageLayout = 3;
  private byte paddingLeft = 2;
  private byte paddingRight = 2;
  private byte spacingBefore = 0;
  private byte spacingAfter = 0;
  private byte lineSpacing = 0;
  private String contentClsCss = "";
  private Map contentStyleCssMap = new HashMap();
  private String borderClsCss = "";
  private Map borderStyleCssMap = new HashMap();
  public static Style DEFAULT_STYLE = new Style();
  public static Style BORDER_STYLE;

  public static Style getInstance()
  {
    Style localStyle = new Style();
    Object localObject = initializeStyle.get(localStyle);
    if (localObject != null)
      return ((Style)localObject);
    initializeStyle.put(localStyle, localStyle);
    return localStyle;
  }

  private static Style getInstance(Background paramBackground, Format paramFormat, FRFont paramFRFont, int paramInt1, Color paramColor1, int paramInt2, Color paramColor2, int paramInt3, Color paramColor3, int paramInt4, Color paramColor4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, int paramInt11, int paramInt12, int paramInt13, int paramInt14, int paramInt15, int paramInt16)
  {
    Style localStyle = new Style(paramBackground, paramFormat, paramFRFont, paramInt1, paramColor1, paramInt2, paramColor2, paramInt3, paramColor3, paramInt4, paramColor4, paramInt5, paramInt6, paramInt7, paramInt8, paramInt9, paramInt10, paramInt11, paramInt12, paramInt13, paramInt14, paramInt15, paramInt16);
    Object localObject = initializeStyle.get(localStyle);
    if (localObject != null)
      return ((Style)localObject);
    initializeStyle.put(localStyle, localStyle);
    return localStyle;
  }

  protected Style()
  {
    DefaultValues localDefaultValues = FRContext.getDefaultValues();
    this.frFont = localDefaultValues.getFRFont();
    this.contentClsCss = contentStyle2class(this.contentStyleCssMap);
    this.borderClsCss = border2Class(this.borderStyleCssMap);
  }

  private Style(Background paramBackground, Format paramFormat, FRFont paramFRFont, int paramInt1, Color paramColor1, int paramInt2, Color paramColor2, int paramInt3, Color paramColor3, int paramInt4, Color paramColor4, int paramInt5, int paramInt6, int paramInt7, int paramInt8, int paramInt9, int paramInt10, int paramInt11, int paramInt12, int paramInt13, int paramInt14, int paramInt15, int paramInt16)
  {
    this.background = paramBackground;
    this.format = paramFormat;
    this.frFont = paramFRFont;
    this.border_top = (byte)paramInt1;
    this.border_top_color = paramColor1;
    this.border_bottom = (byte)paramInt2;
    this.border_bottom_color = paramColor2;
    this.border_left = (byte)paramInt3;
    this.border_left_color = paramColor3;
    this.border_right = (byte)paramInt4;
    this.border_right_color = paramColor4;
    this.horizontal_alignment = (byte)paramInt5;
    this.vertical_alignment = (byte)paramInt6;
    this.textStyle = (byte)paramInt7;
    this.verticalText = (byte)paramInt8;
    this.textDirection = (byte)paramInt9;
    this.rotation = (short)paramInt10;
    this.imageLayout = (byte)paramInt11;
    this.paddingLeft = (byte)paramInt12;
    this.paddingRight = (byte)paramInt13;
    this.spacingBefore = (byte)paramInt14;
    this.spacingAfter = (byte)paramInt15;
    this.lineSpacing = (byte)paramInt16;
    this.contentClsCss = contentStyle2class(this.contentStyleCssMap);
    this.borderClsCss = border2Class(this.borderStyleCssMap);
  }

  public Style deriveFormat(Format paramFormat)
  {
    return getInstance(this.background, paramFormat, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public static Style getInstance(Format paramFormat)
  {
    return DEFAULT_STYLE.deriveFormat(paramFormat);
  }

  public Style deriveFRFont(FRFont paramFRFont)
  {
    return getInstance(this.background, this.format, paramFRFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public static Style getInstance(FRFont paramFRFont)
  {
    return DEFAULT_STYLE.deriveFRFont(paramFRFont);
  }

  public Style deriveBackground(Background paramBackground)
  {
    return getInstance(paramBackground, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public static Style getInstance(Background paramBackground)
  {
    return DEFAULT_STYLE.deriveBackground(paramBackground);
  }

  public Style deriveBorderBackgroundNone()
  {
    return getInstance(null, this.format, this.frFont, 0, this.border_top_color, 0, this.border_bottom_color, 0, this.border_left_color, 0, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveBorder(int paramInt1, Color paramColor1, int paramInt2, Color paramColor2, int paramInt3, Color paramColor3, int paramInt4, Color paramColor4)
  {
    return getInstance(this.background, this.format, this.frFont, paramInt1, paramColor1, paramInt2, paramColor2, paramInt3, paramColor3, paramInt4, paramColor4, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveBorderTop(int paramInt, Color paramColor)
  {
    return getInstance(this.background, this.format, this.frFont, paramInt, paramColor, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveBorderBottom(int paramInt, Color paramColor)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, paramInt, paramColor, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveBorderLeft(int paramInt, Color paramColor)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, paramInt, paramColor, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveBorderRight(int paramInt, Color paramColor)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, paramInt, paramColor, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveHorizontalAlignment(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, paramInt, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveVerticalAlignment(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, paramInt, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveTextStyle(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, paramInt, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveTextDirection(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, paramInt, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveVerticalText(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, paramInt, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveRotation(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, paramInt, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveImageLayout(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, paramInt, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style derivePadding(int paramInt1, int paramInt2)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, paramInt1, paramInt2, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style derivePaddingLeft(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, paramInt, this.paddingRight, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style derivePaddingRight(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, paramInt, this.spacingBefore, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveSpacingBefore(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, paramInt, this.spacingAfter, this.lineSpacing);
  }

  public Style deriveSpacingAfter(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, paramInt, this.lineSpacing);
  }

  public Style deriveLineSpacing(int paramInt)
  {
    return getInstance(this.background, this.format, this.frFont, this.border_top, this.border_top_color, this.border_bottom, this.border_bottom_color, this.border_left, this.border_left_color, this.border_right, this.border_right_color, this.horizontal_alignment, this.vertical_alignment, this.textStyle, this.verticalText, this.textDirection, this.rotation, this.imageLayout, this.paddingLeft, this.paddingRight, this.spacingBefore, this.spacingAfter, paramInt);
  }

  public FRFont getFRFont()
  {
    if (this.frFont == null)
      this.frFont = FRContext.getDefaultValues().getFRFont();
    return this.frFont;
  }

  public Format getFormat()
  {
    return this.format;
  }

  public Background getBackground()
  {
    return this.background;
  }

  public int getBorderTop()
  {
    return this.border_top;
  }

  public int getBorderLeft()
  {
    return this.border_left;
  }

  public int getBorderBottom()
  {
    return this.border_bottom;
  }

  public int getBorderRight()
  {
    return this.border_right;
  }

  public Color getBorderTopColor()
  {
    return this.border_top_color;
  }

  public Color getBorderLeftColor()
  {
    return this.border_left_color;
  }

  public Color getBorderBottomColor()
  {
    return this.border_bottom_color;
  }

  public Color getBorderRightColor()
  {
    return this.border_right_color;
  }

  public int getHorizontalAlignment()
  {
    return this.horizontal_alignment;
  }

  public int getVerticalAlignment()
  {
    return this.vertical_alignment;
  }

  public int getTextStyle()
  {
    return this.textStyle;
  }

  public int getVerticalText()
  {
    return this.verticalText;
  }

  public int getTextDirection()
  {
    return this.textDirection;
  }

  public int getRotation()
  {
    return this.rotation;
  }

  public int getImageLayout()
  {
    return this.imageLayout;
  }

  public int getPaddingLeft()
  {
    return this.paddingLeft;
  }

  public int getPaddingRight()
  {
    return this.paddingRight;
  }

  public byte getSpacingBefore()
  {
    return this.spacingBefore;
  }

  public byte getSpacingAfter()
  {
    return this.spacingAfter;
  }

  public byte getLineSpacing()
  {
    return this.lineSpacing;
  }

  public String getContentClsCss()
  {
    return this.contentClsCss;
  }

  public Map getContentStyleCssMap()
  {
    return this.contentStyleCssMap;
  }

  public String getBorderClsCss()
  {
    return this.borderClsCss;
  }

  public Map getBorderStyleCssMap()
  {
    return this.borderStyleCssMap;
  }

  private String contentStyle2class(Map paramMap)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append("fh");
    switch (this.horizontal_alignment)
    {
    case 0:
      localStringBuffer.append(" tac");
      break;
    case 4:
      localStringBuffer.append(" tar");
    }
    switch (this.vertical_alignment)
    {
    case 3:
      localStringBuffer.append(" vab");
      break;
    case 1:
      localStringBuffer.append(" vat");
    }
    if ((this.textStyle != 0) && (this.textStyle != 3))
      localStringBuffer.append(" nw");
    else
      localStringBuffer.append(" bw");
    FRFont localFRFont = getFRFont();
    if (localFRFont != null)
      localStringBuffer.append(font2Class(localFRFont, paramMap));
    int i = this.paddingLeft;
    int j = this.paddingRight;
    if (i < 2)
      localStringBuffer.append(" pl" + i);
    else if (i > 2)
      paramMap.put("padding-left", i + "px");
    if (j < 2)
      localStringBuffer.append(" pr" + j);
    else if (j > 2)
      paramMap.put("padding-right", j + "px;");
    return localStringBuffer.toString().trim();
  }

  private String border2Class(Map paramMap)
  {
    int i;
    StringBuffer localStringBuffer = new StringBuffer();
    if ((this.border_left == 0) && (this.border_right == 0) && (this.border_top == 0) && (this.border_bottom == 0))
    {
      localStringBuffer.append(" b0");
      return localStringBuffer.toString().trim();
    }
    if ((this.border_left == 1) && (this.border_right == 1) && (this.border_top == 1) && (this.border_bottom == 1) && (ComparatorUtils.equals(this.border_left_color, Color.black)) && (ComparatorUtils.equals(this.border_right_color, Color.black)) && (ComparatorUtils.equals(this.border_top_color, Color.black)) && (ComparatorUtils.equals(this.border_bottom_color, Color.black)))
    {
      localStringBuffer.append(" b1");
      return localStringBuffer.toString().trim();
    }
    if ((this.border_right == 1) && (ComparatorUtils.equals(this.border_right_color, Color.black)))
    {
      localStringBuffer.append(" br1");
    }
    else if ((i = IOHelper.getBorderWidth(this.border_right)) > 0)
    {
      localStringBuffer.append(" brw" + i);
      localStringBuffer.append(" " + __border2Class(this.border_right, "r"));
      if (ComparatorUtils.equals(this.border_right_color, Color.black))
        localStringBuffer.append(" brcb");
      else
        paramMap.put("border-right-color", Utils.javaColorToCSSColor(this.border_right_color));
    }
    else
    {
      localStringBuffer.append(" br0");
    }
    if ((this.border_bottom == 1) && (ComparatorUtils.equals(this.border_bottom_color, Color.black)))
    {
      localStringBuffer.append(" bb1");
    }
    else if ((i = IOHelper.getBorderWidth(this.border_bottom)) > 0)
    {
      localStringBuffer.append(" bbw" + i);
      localStringBuffer.append(" " + __border2Class(this.border_bottom, "b"));
      if (ComparatorUtils.equals(this.border_bottom_color, Color.black))
        localStringBuffer.append(" bbcb");
      else
        paramMap.put("border-bottom-color", Utils.javaColorToCSSColor(this.border_bottom_color));
    }
    else
    {
      localStringBuffer.append(" bb0");
    }
    if ((this.border_left == 1) && (ComparatorUtils.equals(this.border_left_color, Color.black)))
    {
      localStringBuffer.append(" bl1");
    }
    else if ((i = IOHelper.getBorderWidth(this.border_left)) > 0)
    {
      localStringBuffer.append(" blw" + i);
      localStringBuffer.append(" " + __border2Class(this.border_left, "l"));
      if (ComparatorUtils.equals(this.border_left_color, Color.black))
        localStringBuffer.append(" blcb");
      else
        paramMap.put("border-left-color", Utils.javaColorToCSSColor(this.border_left_color));
    }
    else
    {
      localStringBuffer.append(" bl0");
    }
    if ((this.border_top == 1) && (ComparatorUtils.equals(this.border_top_color, Color.black)))
    {
      localStringBuffer.append(" bt1");
    }
    else if ((i = IOHelper.getBorderWidth(this.border_top)) > 0)
    {
      localStringBuffer.append(" btw" + i);
      localStringBuffer.append(" " + __border2Class(this.border_top, "t"));
      if (ComparatorUtils.equals(this.border_top_color, Color.black))
        localStringBuffer.append(" btcb");
      else
        paramMap.put("border-top-color", Utils.javaColorToCSSColor(this.border_top_color));
    }
    else
    {
      localStringBuffer.append(" bt0");
    }
    return localStringBuffer.toString().trim();
  }

  private static String __border2Class(int paramInt, String paramString)
  {
    switch (paramInt)
    {
    case 1:
    case 2:
    case 5:
      return "b" + paramString + "ss";
    case 6:
      return "b" + paramString + "sd";
    case 7:
    case 9:
    case 11:
      return "b" + paramString + "sdo";
    case 3:
    case 4:
    case 8:
    case 10:
    }
    return "b" + paramString + "sda";
  }

  private static String font2Class(Font paramFont, Map paramMap)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    if (paramFont.isBold())
      localStringBuffer.append(" fwb");
    if (paramFont.isItalic())
      localStringBuffer.append(" fsi");
    String str1 = paramFont.getName();
    String str2 = (String)clsFontFamily.get(str1);
    if (str2 == null)
      paramMap.put("font-family", str1);
    else if (!(str2.equals("fnss")))
      localStringBuffer.append(" " + str2);
    int i = paramFont.getSize();
    if (i == 12)
      break label197:
    if ((i >= 8) && (i <= 26))
      localStringBuffer.append(" f" + i);
    else
      paramMap.put("font-size", paramFont.getSize() + "px");
    if (paramFont instanceof FRFont)
    {
      if (((FRFont)paramFont).isStrikethrough())
        label197: localStringBuffer.append(" tdst");
      if (((FRFont)paramFont).getUnderline() != 0)
        localStringBuffer.append(" tdu");
      if ((((FRFont)paramFont).isSubscript()) || (((FRFont)paramFont).isSuperscript()))
        localStringBuffer.append(" fvsc");
      Color localColor = ((FRFont)paramFont).getForeground();
      if (!(ComparatorUtils.equals(localColor, Color.black)))
        paramMap.put("color", Utils.javaColorToCSSColor(localColor));
    }
    return localStringBuffer.toString();
  }

  public int hashCode()
  {
    int i = this.border_top ^ this.border_bottom ^ this.border_left ^ this.border_right ^ this.border_top_color.hashCode() ^ this.border_bottom_color.hashCode() ^ this.border_left_color.hashCode() ^ this.border_right_color.hashCode() ^ this.frFont.hashCode() ^ this.horizontal_alignment ^ this.imageLayout ^ this.verticalText ^ this.paddingLeft ^ this.paddingRight ^ this.rotation ^ this.textDirection ^ this.textStyle ^ this.vertical_alignment ^ this.spacingBefore ^ this.spacingAfter ^ this.lineSpacing;
    return ((this.background instanceof com.fr.base.background.ColorBackground) ? i ^ this.background.hashCode() : i);
  }

  public boolean equals(Object paramObject)
  {
    if (paramObject == this)
      return true;
    if (!(paramObject instanceof Style))
      return false;
    Style localStyle = (Style)paramObject;
    return ((ComparatorUtils.equals(localStyle.getFormat(), getFormat())) && (ComparatorUtils.equals(localStyle.getFRFont(), getFRFont())) && (ComparatorUtils.equals(localStyle.getBackground(), getBackground())) && (localStyle.getBorderTop() == getBorderTop()) && (localStyle.getBorderLeft() == getBorderLeft()) && (localStyle.getBorderBottom() == getBorderBottom()) && (localStyle.getBorderRight() == getBorderRight()) && (ComparatorUtils.equals(localStyle.getBorderTopColor(), getBorderTopColor())) && (ComparatorUtils.equals(localStyle.getBorderLeftColor(), getBorderLeftColor())) && (ComparatorUtils.equals(localStyle.getBorderBottomColor(), getBorderBottomColor())) && (ComparatorUtils.equals(localStyle.getBorderRightColor(), getBorderRightColor())) && (localStyle.getHorizontalAlignment() == getHorizontalAlignment()) && (localStyle.getVerticalAlignment() == getVerticalAlignment()) && (localStyle.getTextStyle() == getTextStyle()) && (localStyle.getVerticalText() == getVerticalText()) && (localStyle.getTextDirection() == getTextDirection()) && (localStyle.getRotation() == getRotation()) && (localStyle.getImageLayout() == getImageLayout()) && (localStyle.getPaddingLeft() == getPaddingLeft()) && (localStyle.getPaddingRight() == getPaddingRight()) && (localStyle.getSpacingBefore() == getSpacingBefore()) && (localStyle.getSpacingAfter() == getSpacingAfter()) && (localStyle.getLineSpacing() == getLineSpacing()));
  }

  public Object clone()
    throws CloneNotSupportedException
  {
    return this;
  }

  protected Object readResolve()
    throws InvalidObjectException
  {
    if (super.getClass() != Style.class)
      throw new InvalidObjectException("subclass didn't correctly implement readResolve");
    Object localObject = initializeStyle.get(this);
    if (localObject == null)
    {
      localObject = this;
      initializeStyle.put(this, localObject);
    }
    return localObject;
  }

  static
  {
    DefaultValues localDefaultValues = FRContext.getDefaultValues();
    DEFAULT_STYLE = DEFAULT_STYLE.deriveFRFont(localDefaultValues.getFRFont());
    BORDER_STYLE = new Style();
    localDefaultValues = FRContext.getDefaultValues();
    BORDER_STYLE = BORDER_STYLE.deriveFRFont(localDefaultValues.getFRFont());
    BORDER_STYLE = BORDER_STYLE.deriveBorder(1, Color.black, 1, Color.black, 1, Color.black, 1, Color.black);
  }
}